import 'package:flutter/material.dart';

main() =>
    runApp(MaterialApp(debugShowCheckedModeBanner: false, home: HomePage()));

class HomePage extends StatefulWidget {
  @override
  createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  final _textController = TextEditingController();
  @override
  build(context) => Scaffold(
        appBar: AppBar(),
        body: Column(
          children: [
            TextField(
              controller: _textController,
            )
          ],
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            return showDialog(
                context: context,
                builder: (context) => AlertDialog(
                      content: Text(_textController.text),
                    ));
          },
        ),
      );
}
